CFLAGS =  -pthread -g -lm
VPATH = src
CC=gcc
ODIR=obj
SDIR=src
BDIR=bin

_objects = $(patsubst %.c,%.o,$(wildcard $(SDIR)/*.c))
objects = $(patsubst $(SDIR)/%,$(ODIR)/%,$(_objects))

$(ODIR)/%.o: %.c
	$(CC) -c -o $@ $< $(CFLAGS)

generator: $(objects)
	gcc -o $(BDIR)/$@ $^ $(CFLAGS)

.PHONY: clean

clean:
	rm $(BDIR)/generator $(ODIR)/*.o ./tmp/*
